package com.codecentric.sample.store.service;

import com.codecentric.sample.store.model.Customer;
import com.codecentric.sample.store.service.external.ExternalHostService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.IOException;

@Service
public class CustomerService {

    @Autowired
    private ExternalHostService hostService;


    public String getAddress(Customer customer) throws IOException {
        if(hostService.connect())
            return hostService.getAddress(0);
        return null;
    }
}
